# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Francois Boulogne <fboulogne at april dot org>

pkgname=python-watchdog
pkgver=2.3.0
pkgrel=2
pkgdesc="Python API and shell utilities to monitor file system events"
arch=('any')
url="https://github.com/gorakhargosh/watchdog"
license=('Apache')
depends=('python')
optdepends=('python-yaml: for watchmedo')
makedepends=('python-setuptools')
checkdepends=('python-pytest' 'python-pytest-timeout')
source=($pkgname-$pkgver.tar.gz::https://github.com/gorakhargosh/watchdog/archive/v$pkgver.tar.gz)
sha512sums=('733d408e74a81ce834075472d7488e8d767f80ef92a2a13cc986c1f5d879b0353f0cb85c1996168ae6b8b82d135bcb26c6c18b51a01a8d75915bdec94acd607d')

prepare() {
  cd watchdog-$pkgver
  sed -i '/--cov/d' setup.cfg
}

build() {
  cd watchdog-$pkgver
  python setup.py build
}

check() {
  cd watchdog-$pkgver
  # Invokes sudo
  PYTHONPATH="$PWD/build/lib" pytest --deselect tests/test_inotify_buffer.py::test_unmount_watched_directory_filesystem
}

package() {
  cd watchdog-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
}

# vim:ts=2:sw=2:et:
